<template>
  <div class="test">
    <img :src="tu_00" >
    <img :src="tu_01" >
    <h1>{{txt_01}}</h1>
    <h2>{{txt_01}}</h2>
    <h3>{{txt_01}}</h3>
    <h4>
      {{txt_00}}
    </h4>
    <h3>
      {{"解密后的图片路径:"+tu_00}}
    </h3>
    <h3>
      {{"解密后的图片路径:"+tu_01}}
    </h3>
  </div>
</template>

<script>
  export default{
    data(){
      return{
        txt_00:"5L2g5aW95ZWK",
        txt_01:"6L+Z5piv5paH5a2X",
        tu_00:"d3gucG5n",
        tu_01:"cXEucG5n"
      }
    },
    mounted() {
      let that=this;
      var Base64 = require('js-base64').Base64;
      that.txt_00 = Base64.decode(that.txt_00);
      that.txt_01 = Base64.decode(that.txt_01);
      that.tu_00=Base64.decode(that.tu_00);
      that.tu_01=Base64.decode(that.tu_01);
      that.tu_00 = require('@/assets/img/account/'+that.tu_00);
      that.tu_01 = require('@/assets/img/account/'+that.tu_01);
    },
    created(){
        this.$nextTick(() => {
          // 禁用右键
          document.oncontextmenu = new Function('event.returnValue=false')
          // 禁用选择
          document.onselectstart = new Function('event.returnValue=false')
          // //禁止f12
          // document.οnkeydοwn = new Function('event.returnValue=false')

          document.ondragstart = new Function('event.returnValue=false')
          document.ondrag= new Function('event.returnValue=false')
          document.ondragend= new Function('event.returnValue=false')

          document.onkeydown=(e)=>{
            const keyCode = event.keyCode || event.which || event.charCode;
            const keyCtrl = event.ctrlKey; // 布尔类型
            const keyShift = event.shiftKey; // 布尔类型 
            if(keyCode==123){ // f12
               event.returnValue=false;
            }else if(keyCtrl&&keyCode==83){ // ctrl+s
               event.returnValue=false;
            }else if(keyCtrl&&keyCode==85){ // ctrl+u
               event.returnValue=false;
            }else if(keyShift&&keyCtrl&&keyCode==73){ // ctrl+shift+s
               event.returnValue=false;
            }
          }
        })

        // 上面的禁止f12那段代码没有生效，但是加了下面这段就能生效。
        document.onkeydown = function (e) {
          if (e && e.keyCode === 123) {
            e.returnValue = false
            // e.keyCode = 0   //去掉也可以的，倘若要写，则需要setter 以及 getter配合使用，不配合，会报错
            return false
          }
        }
      },
    methods:{

    }
  }
</script>

<style>
</style>
